﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace MaguenBrokersMVC.Models
{
    public class SeguroVehiculo
    {
        [ScaffoldColumn(false)]
        public virtual int Id { get; set; }

        [Required(ErrorMessage = "*")]
        public virtual string Nombre { get; set; }

        [Required(ErrorMessage = "*")]
        public virtual string Apellido { get; set; }

        [Required(ErrorMessage = "*")]
        [RegularExpression(@"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$", ErrorMessage = "Ingrese un email válido por favor.")]
        [DataType(DataType.EmailAddress)]
        public virtual string Email { get; set; }

        public virtual string Telefono { get; set; }

        [DisplayName("Tipo de Vehiculo")]
        [Required(ErrorMessage = "*")]
        public int VehiculoTipoId { get; set; }

        [DisplayName("Marca")]
        [Required(ErrorMessage = "*")]
        public int VehiculoMarcaId { get; set; }

        [DisplayName("Modelo")]
        [Required(ErrorMessage = "*")]
        public int VehiculoModeloId { get; set; }

        [DisplayName("Tipo de Vehiculo")]
        public virtual VehiculoTipo VehiculoTipo { get; set; }

        [DisplayName("Marca")]
        public virtual VehiculoMarca VehiculoMarca { get; set; }

        [DisplayName("Modelo")]
        public virtual VehiculoModelo VehiculoModelo { get; set; }


        [Required(ErrorMessage = "*")]
        public string Combustible { get; set; }

        [Required(ErrorMessage = "*")]
        public string Año { get; set; }

    }

    public class VehiculoTipo
    {
        public int Id { get; set; }
        public string Nombre { get; set; }
    }

    public class VehiculoMarca
    {
        public int Id { get; set; }
        public string Nombre { get; set; }
    }

    public class VehiculoModelo
    {
        public int Id { get; set; }
        public string Nombre { get; set; }
        public VehiculoTipo VehiculoTipo { get; set; }
        public VehiculoMarca VehiculoMarca { get; set; }
    }
}